import {onMounted, onUnmounted} from "vue";

export function useMouseMove(target:Window | Document | HTMLElement,
                             event:string,
                             callback: (event:any) => void
) {
    onMounted(() => target.addEventListener(event, callback));
    target.addEventListener(event, (e: Event) => {
        callback(e);
    });
    // onUnmounted(() => target.removeEventListener(event, callback));
}